﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace ModelLayer
{
    [DataContract]
    public class Seat
    {
        [DataMember]
        public string SeatNo { get; set; }
        [DataMember]
        public string PlaneNo { get; set; }
        public Seat()
        {

        }
        //Overrides equals to compare Seats based on their seat. and plane number
        public override bool Equals(object _obj)
        {
            bool equal = false;
            Seat objSeat = (Seat) _obj;
            if (SeatNo.Equals(objSeat.SeatNo) && PlaneNo.Equals(objSeat.PlaneNo))
            {
                equal = true;
            }
            return equal;
        }
        //Overrides the string representation of the object
        public override string ToString()
        {
            return string.Format("Seat number: {0} \n Plane number: {1}", SeatNo, PlaneNo);
        }
    }
}
